<?php
require 'header_update.php';
require 'function.php';
if($_POST['check_backup'] != 'on')
{
  redirect('index.php?error=no_check');
  exit;  
} 
// script de mise a jour
require '../conf/config.php';
// connexion a la base
require '../kernel/db/class_mysql.php';
$db = new db_sql();
$db->sql_connect($basesql);
// recuperation de la version
$V = $db->sql_query("SELECT * FROM immo_config WHERE module = 'version' ",'OBJECT');
$version = $V->setting;

switch($version)
{
    case '1.0.0';
    require 'sql/update_1.0.0_to_1.1.0.php';
    require 'sql/update_1.1.0_to_1.1.1.php';
    redirect('update/update_110_to_111.php',5);
    break;
    
    case '1.1.0';
    require 'sql/update_1.1.0_to_1.1.1.php';
    redirect('update/update_110_to_111.php',5);
    break;
}
?>